package com.example.schedule.job;

import com.example.schedule.ScheduleApplication;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;

public class HelloJob extends QuartzJobBean {
    private final static Logger log = LoggerFactory.getLogger(ScheduleApplication.class);

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        context.getJobDetail().getJobDataMap().forEach((k,v)->{
            log.info("param,key:{},value:{}",k,v);
        });
        // your logics
        log.info("Hello Job执行时间: " + new Date());
    }
}
